<%@ page import="java.util.List" %>

<%@ taglib uri="/WEB-INF/bpmapp.tld" prefix="ssp" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/bv-html.tld" prefix="bvhtml" %>

<% String ctPath = request.getContextPath(); %>

<div class="blockTitle">
   <span class="left">
     <bean:message bundle="appCommonRes" key="bp.myContent.inbox" />
   </span>
   <span class="right">&nbsp;</span>
</div>

<div class="blockWrap">
  <div class="subBlockTable" align="right">   
    <html:link page="/ca/contentCreate.do">
      <bean:message bundle="appCommonRes" key="bp.myContent.createContent"/>
    </html:link>
  </div>

  <table width="100%" class="dataTable" border="0" cellspacing="1" cellpadding="2" summary="<bean:message bundle="appCommonRes" key="bp.myContent.inbox"/>">
    <tr class="listHeader">
      <th id="Name" align="left">
        <bean:message bundle="appCommonRes" key="bp.myContent.name" />
      </th>
      <th id="Modified On" align="left">
        <bean:message bundle="appCommonRes" key="bp.myContent.modifiedOn" />
      </th>
      <th id="Modified By" align="left">
        <bean:message bundle="appCommonRes" key="bp.myContent.modifiedBy" />
      </th>
    </tr>

    <ssp:myContent id="contentList"/>

    <logic:iterate id="contentItem" name="contentList" length="5" indexId="index">
    <tr class="<%=index.intValue() % 2 == 0? "listEven" : "listOdd" %>" >

      <td headers="Name">
        <html:link page="/ca/myContentDocInfo.do?" name="contentItem" property="urlParams">
          <bean:write name="contentItem" property="name" />
        </html:link>
      </td>  
			<td headers="Modified On">
        <bean:write name="contentItem" property ="modifiedOn" formatKey="format.datetime.short" />
      </td>
      <td headers="Modified By">
        <bean:write name="contentItem" property ="modifiedBy" formatKey="format.datetime.short"/>
      </td>
    </tr>
    </logic:iterate>

<% 
  int numContents = ((List)pageContext.getAttribute("contentList")).size();
  int maxToDisplay = 5;

  if (numContents <= 0)
  {
%>

  <tr class="listOdd">
    <td colspan="3" align="center">
      <bean:message bundle="appCommonRes" key="bp.myContent.noContent" />

<% 
  }
  else if ( numContents >= maxToDisplay) 
  { 
%>

  <tr class="listOdd">
    <td colspan="3"> <br>
      <bean:message bundle="appCommonRes" key="show.no.of.all" arg0="<%=Integer.toString(maxToDisplay)%>" arg1="<%=Integer.toString(numContents)%>"/>&nbsp; &nbsp;
        <html:link page="/ca/allMyContent.do">
          <bean:message bundle="appCommonRes" key="view.full.details" />
        </html:link>
  
<% 
  } 
  else 
  {
%>  
  <tr class="listOdd">
    <td colspan="3"> <br>
      <html:link page="/ca/allMyContent.do">
        <bean:message bundle="appCommonRes" key="view.full.details" />
      </html:link>
<%
  }
%>

    </td>
  </tr>
</table>
</div>
